# Contributor: Jakub Jirutka <jakub@jirutka.cz>
# Maintainer: Jakub Jirutka <jakub@jirutka.cz>
pkgname=yubikey-touch-detector
pkgver=1.9.3
pkgrel=4
pkgdesc="Tool to detect when your YubiKey is waiting for a touch"
url="https://github.com/maximbaz/yubikey-touch-detector"
arch="all !armhf !armv7 !x86"  # fails to build
license="ISC"
makedepends="go"
# Note: SVG image is based on https://github.com/Yubico/yubioath-desktop/blob/main/images/touch.svg.
source="https://github.com/maximbaz/yubikey-touch-detector/archive/$pkgver/yubikey-touch-detector-$pkgver.tar.gz
	libnotify-set-appicon.patch
	yubikey-touch-detector.svg
	"
options="!check"  # no tests provided

prepare() {
	default_prepare
	sed -i 's/GOFLAGS :=/GOFLAGS +=/' Makefile
}

build() {
	make GOFLAGS="$GOFLAGS -tags=netcgo -v"
}

package() {
	make DESTDIR="$pkgdir" install

	# Nothing useful
	rm -rf "$pkgdir"/usr/lib
	rm -rf "$pkgdir"/usr/share

	install -D -m644 "$srcdir"/yubikey-touch-detector.svg -t "$pkgdir"/usr/share/pixmaps/
}

sha512sums="
fce4c2a7b68a3e246f45c3122405b889226f189b945620a9f8f57be43e3c874e7af9c70100dacd8af2a40e5938b5d2b7df0d4916e53981a5130084f1040864d9  yubikey-touch-detector-1.9.3.tar.gz
c9092d13a173df1d463c8bfb0651a75a1f594865024e585da4080303284507d3a6f5e585eb631a65c832c2c7024b9f0aae68115c6a6ec38d72121097262e7929  libnotify-set-appicon.patch
4b37793b5ab01391ddc808d8a4cd1650f0fb971e582883f7ef9954d9c72d4f9968f0a32fed311fafaa08c5fc0f1880e25dbf2be698cb312ca8be3f8aac27998b  yubikey-touch-detector.svg
"
